#ifndef MAIN_H
#define MAIN_H


#include "BasicGameCard.h"
#include "instance.h"
#include "user.h"
#include "MsgModPC.h"
#include <map>
#include "macros.h"

using namespace std;


class CMsgSocket
{
public:
	void Init(class CMain *m) { Main = m; }
	
	//map<T_Socket, CUser *> SocketMD;
	//map<CUser::T_UserUniqueID, T_Socket> UserSocket;

	void BeginAccept();

private:
	//T_SocketMD SocketMD;
	class CMain *Main;
};

class CMain : public CMsgModPC
{
public:
	CBasicGameCard	BasicCard;

	typedef map<CUser::T_UserUniqueID, CUser *> T_UserMap;
	typedef map<CGameInstance::T_InstanceID, CGameInstance *> T_InstanceMap;

	T_UserMap	Users;
	T_InstanceMap	Instances;

public:
	CMain() : CMsgModPC() {}

	CMsgSocket MsgSocket;

    virtual void MOnRecvMsg(unsigned int type, T_LParameter lp, const DataFlow &data);

	void EnterMainThread();
};





#endif